package com.example.wishstar.model;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.Index;
import androidx.room.PrimaryKey;

@Entity(tableName = "starflag", indices ={@Index(value = {"starflagId"}, unique = true)})
public class StarFlag {

    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "starflagId", typeAffinity = ColumnInfo.INTEGER)
    public int starflagId;

    @ColumnInfo(name = "userId", typeAffinity = ColumnInfo.INTEGER)
    public int userId;

    @ColumnInfo(name = "wishId", typeAffinity = ColumnInfo.INTEGER)
    public int wishId;

    @ColumnInfo(name = "flag", typeAffinity = ColumnInfo.INTEGER)
    public int flag;

    public StarFlag(int starflagId, int userId, int wishId, int flag) {
        this.starflagId = starflagId;
        this.userId = userId;
        this.wishId = wishId;
        this.flag = flag;
    }

    @Ignore
    public StarFlag(int userId, int wishId, int flag) {
        this.userId = userId;
        this.wishId = wishId;
        this.flag = flag;
    }

    @Ignore
    public StarFlag() {

    }

    @Override
    public String toString() {
        return "StarFlag{" +
                "starflagId=" + starflagId +
                ", usedId=" + userId +
                ", wishId=" + wishId +
                ", flag=" + flag +
                '}';
    }
}
